<!doctype html>
<html lang="en" xmlns="http://www.w3.org/1999/html" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
	<link rel="stylesheet" href="/css/index.css"/>
	<script src="/js/main.js" th:src="@{/js/main.js}"></script>
	<title>易书网</title>
</head>
<style>
	.help-main p {
		line-height: 50px;
	}
</style>
<body >

<!--引入 尾部片段-->
<div  th:replace="mall/common/mall_common :: header"></div>


<div class="help-wrap">
	<div class="container clearfix">
		<div class="bread">当前位置：
			<a href="index.html">首页</a> >
			<a href="member.html">个人中心</a> >
			<a href="member.html">个人信息</a>
		</div>
		<div  th:replace="mall/common/mall_common :: left"></div>
		<div class="help-r fr">
			<div class="help-item-title">个人信息</div>
			<div class="help-main">
				<form action="">
					<input type="hidden" th:value="${session.mallUser.id}" name="id" id="memId">
					<p><span class="nice">用户名：</span><span th:text="${session.mallUser.getUserName()}" >2078140086</span></p>
					<p><span class="nice">昵称：</span><input type="text"  th:value="${session.mallUser.getNickName()}" id="NickName" required="required">
					<span class="nice">联系电话：</span><input type="text" th:value="${session.mallUser.getPhone()}" id="phone" required="required"></p>
					<p><span class="nice">邮箱：</span><input type="text" th:value="${session.mallUser.getEmail()}" id="email" required="required"></p>
					<h3 id="messages" style="color: red; margin-left: 100px"></h3>
					<input class="save" type="submit" value="修改"/>
				</form>
			</div>
		</div>
	</div>
</div>




<!--引入 尾部片段-->
<div  th:replace="mall/common/mall_common :: footer"></div>
<script  src="js/jquery-3.4.1.js" th:src="@{/js/jquery-3.4.1.js}"></script>
<script>

	$("form").submit(function () {
		var NickName=$("#NickName").val();
		var phone=$("#phone").val();
		var email=$("#email").val();
		var id=$("#memId").val();
		$.ajax({
			url:"/user/memberInfo",
			dataType:"JSON",
			type:"get",
			data:{"NickName":NickName,"phone":phone,"email":email,"id":id},
			success:function (data) {
				if (data.success){
					$("#messages").html("")
					$("#messages").append(data.content);
					$("form").reset();
				}
					$("#messages").html("")
					$("#messages").append(data.content);
			}
		})
		return false;
	})

	$("#dataList").click(function () {
		var data = $("#bookName").val();
		console.log(data)
		location.href="/mall/list.html?bookName="+data;
		return false;
	})
</script>

</body>
</html>